projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b4ba169
)
tiny-printf: Support sprintf()
author
Marek Vasut
<
[email protected]
>
Tue, 31 May 2016 21:12:46 +0000
(23:12 +0200)
committer
Tom Rini
<
[email protected]
>
Fri, 3 Jun 2016 01:21:42 +0000
(21:21 -0400)
Add a simple version of this function for SPL. It does not check the buffer
size as this would add to the code size.
Signed-off-by: Marek Vasut <
[email protected]
>
Cc: Simon Glass <
[email protected]
>
Cc: Stefan Roese <
[email protected]
>
Cc: Tom Rini <
[email protected]
>
Cc:
[email protected]
Reviewed-by: Tom Rini <
[email protected]
>
Reviewed-by: Sylvain Lesne <
[email protected]
>
Tested-by: Sylvain Lesne <
[email protected]
>
lib/tiny-printf.c
patch
|
blob
|
history
diff --git
a/lib/tiny-printf.c
b/lib/tiny-printf.c
index 4b70263df7d73992c2a858205f45370d31f7056a..5ea2555280b1561da6e072d6d8092b9e2b2325f3 100644
(file)
--- a/
lib/tiny-printf.c
+++ b/
lib/tiny-printf.c
@@
-147,8
+147,7
@@
static void putc_outstr(char ch)
*outstr++ = ch;
}
-/* Note that size is ignored */
-int snprintf(char *buf, size_t size, const char *fmt, ...)
+int sprintf(char *buf, const char *fmt, ...)
{
va_list va;
int ret;
@@
-161,3
+160,16
@@
int snprintf(char *buf, size_t size, const char *fmt, ...)
return ret;
}
+
+/* Note that size is ignored */
+int snprintf(char *buf, size_t size, const char *fmt, ...)
+{
+ va_list va;
+ int ret;
+
+ va_start(va, fmt);
+ ret = sprintf(buf, fmt, va);
+ va_end(va);
+
+ return ret;
+}